Class symantec.itools.lang.Debug
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class symantec.itools.lang.Debug

Object
   |
   +----symantec.itools.lang.Debug

public class Debug
extends Object
Provides a single debug log file to be used by any number of classes.

Version:
1.0, 07/01/1998
Author:
D'Arcy Smith
Since:
VCafe 2.1a

Variable Index

 o OSName
The value of the system property "os.name";
 o OSPlatform
The value of the system property "os.arch";
 o OSVersion
The value of the system property "os.version";
 o writer
The PrintWriter used for output.

Constructor Index

 o symantec.itools.lang.Debug()
Constructor - this should not be called...

Method Index

 o finish()
Finish writing the debug log.
 o getLineNumber()
Get the current line number This has only been tested with the Sun JDK 1.1.5 and VCafe JDK 1.1.4 on Windows.
 o setWriter(String, Object, String)
Set the file name to write the debug log to
 o setWriter(URL, Object, String)
Set the url to write the debug log to
 o setWriter(File, Object, String)
Set the file to write the debug log to
 o setWriter(OutputStream, Object, String)
Set the stream to write the debug log to
 o setWriter(Writer, Object, String)
Set the writer to write the debug log to.
 o write(String)
Write out a debug message
 o write(Object, long, String)
Write out a debug message
 o write(Object, long, String, String)
Write out a debug message
 o write(Object, long, Throwable)
Write out a debug message

Variables

 o OSName
protected static java.lang.String OSName
The value of the system property "os.name";

 o OSPlatform
protected static java.lang.String OSPlatform
The value of the system property "os.arch";

 o OSVersion
protected static java.lang.String OSVersion
The value of the system property "os.version";

 o writer
protected static java.io.PrintWriter writer
The PrintWriter used for output.

See Also:
setWriter(java.lang.String, java.lang.Object, java.lang.String), setWriter(java.net.URL, java.lang.Object, java.lang.String), setWriter(java.io.File, java.lang.Object, java.lang.String), setWriter(java.io.OutputStream, java.lang.Object, java.lang.String), setWriter(java.io.Writer, java.lang.Object, java.lang.String)

Constructors

 o Debug
protected Debug()
Constructor - this should not be called... it is only protected so that Debug can be subclassed.

Methods

 o finish
public static synchronized void finish()
Finish writing the debug log.

 o getLineNumber
public static synchronized long getLineNumber()
Get the current line number This has only been tested with the Sun JDK 1.1.5 and VCafe JDK 1.1.4 on Windows. I need to make use of the OS class & Java Vendor to make it work for others (assuming they display stack traces differently from Sun and Symantec).

 o setWriter
public static synchronized boolean setWriter(String fileName,
                                             Object clazz,
                                             String version) throws IOException
Set the file name to write the debug log to

Parameters:
fileName - the file name of the debug log
clazz - the class that had "main" called
version - the version of clazz
Returns:
true if the writer was set false if the writer already has a value
Throws: IOException
if any error occured attaching the log file
 o setWriter
public static synchronized boolean setWriter(URL url,
                                             Object clazz,
                                             String version) throws IOException
Set the url to write the debug log to

Parameters:
url - the url of the debug log
clazz - the class that had "main" called
version - the version of clazz
Returns:
true if the writer was set false if the writer already has a value
Throws: IOException
if any error occured attaching the log file
 o setWriter
public static synchronized boolean setWriter(File file,
                                             Object clazz,
                                             String version) throws IOException
Set the file to write the debug log to

Parameters:
file - the file of the debug log
clazz - the class that had "main" called
version - the version of clazz
Returns:
true if the writer was set false if the writer already has a value
Throws: IOException
if any error occured attaching the log file
 o setWriter
public static synchronized boolean setWriter(OutputStream stream,
                                             Object clazz,
                                             String version)
Set the stream to write the debug log to

Parameters:
stream - the stream of the debug log
clazz - the class that had "main" called
version - the version of clazz
Returns:
true if the writer was set false if the writer already has a value
Throws: IOException
if any error occured attaching the log file
 o setWriter
public static synchronized boolean setWriter(Writer w,
                                             Object clazz,
                                             String version)
Set the writer to write the debug log to. If the writer (of the class - not the param) is null then the log will be assigned.

Parameters:
writer - the writer of the debug log
clazz - the class that had "main" called
version - the version of clazz
Returns:
true if the writer was set false if the writer already has a value
Throws: IOException
if any error occured attaching the log file
 o write
public static synchronized void write(String msg)
Write out a debug message

Parameters:
msg - the message to write
 o write
public static synchronized void write(Object src,
                                      long line,
                                      String msg)
Write out a debug message

Parameters:
src - an instance of the class where the message is coming from
msg - the message to write
 o write
public static synchronized void write(Object src,
                                      long line,
                                      String action,
                                      String result)
Write out a debug message

Parameters:
src - an instance of the class where the message is coming from
action - the action that is being reported
result - the reult of the action
 o write
public static synchronized void write(Object src,
                                      long line,
                                      Throwable ex)
Write out a debug message

Parameters:
src - an instance of the class where the message is coming from
ex - the exception that was thrown

All Packages  Class Hierarchy  This Package  Previous  Next  Index